public class Test2023 {
    static int[] aim = {3,2,0,2};
    public static void main(String[] args) {
        String str = "";
        int count=0;

        for (int i = 12345678; i <=98765432 ; i++) {
            if(!handle(i)) count++;
        }
        System.out.println(count);
    }
    private static boolean handle(int n) {
        int r=3;
            while (n>0 && r>=0) {
                int m = n%10;
                n/=10;
                if(m==aim[r])r--;
            }
            if(r<0) return true;
            return false;
    }

}
